<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <script>



    // class用途: 创建对象, 是构造函数的语法疼

    // 🔔如何定义class
    // 语法:  
    // class Xxxx { 

    // 属性 = 属性值; 
    // 方法名(){};   

    // }
    class Person {
      name = "zs";

      age = 18;

      sayHello() {
        console.log('123  ----->  ',);
      }

      sayHi = () => {
        console.log('arrow  fn  ----->  ',);
      }
    }



    // 继承的语法: 
    // 作用: 复制爸爸所有的属性和方法, 类似原型对象继承
    // class Xxx  extends Yyyy  {}
    class BlackMan extends Person {
      name = "borlt"
    }


    const borlt = new BlackMan();

    console.log('borlt  ----->  ', borlt);



  </script>

</body>

</html>